<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		
		/*第三种解决塌陷的方法*/
		.clearfix:before{
			content: '';
			display: table;
		}

		.con{
			width: 300px;
			height: 300px;
			background-color: pink;
			/*border: 1px solid #000; 第一种解决塌陷的方法*/

			/*overflow: hidden; 第二种解决塌陷的方法*/
		}

		.box{
			width: 200px;
			height: 100px;
			background-color: red;
			margin-top: 100px;
			margin-left: 50px;
		}
		
	</style>
</head>

<body>
	<div class="con clearfix">
		<div class="box"></div>
	</div>
</body>
</html>